dota_app.component('videoPlayer', {
    templateUrl: 'component/video_player/video_player.html',
    controller: function() {
        var ctrl = this;
        ctrl.isPlaying = false;
        ctrl.player = function() {
            var flashvars = {
                skincolor1: 'ffffff',
                skincolor2: 'ffffff',
                VideoIDS: ctrl.srcVideo.src_video_id_encryption,
                ShowId: '0',
                category: '99',
                Cp: '0',
                unCookie: '0',
                frame: 'undefined',
                uepflag: '0',
                Tid: '0',
                isAutoPlay: 'true',
                playmode: '1',
                show_ce: '1',
                winType: 'interior',
                Fid: '0',
                Pt: '0',
                Ob: '0',
                plchid: '',
                embedid: 'AjQ3MDAzMDA0NAJpLnlvdWt1LmNvbQIvaS9VTXpFMk9UWTJOalV5L3ZpZGVvcw==',
                ysuid: '1461210001238cV8',
                vext: 'bc%3D%26pid%3Dundefined%26unCookie%3Dundefined%26frame%3Dundefined%26type%3D1%26fob%3D0%26fpo%3D0%26svt%3D0%26cna%3DTU8aEJ9plhYCATsodfDzXjgX%26emb%3DAjQ3MDAzMDA0NAJpLnlvdWt1LmNvbQIvaS9VTXpFMk9UWTJOalV5L3ZpZGVvcw%3D%3D%26dn%3D%E7%BD%91%E9%A1%B5%26hwc%3D1%26mtype%3Doth',
                cna: 'TU8aEJ9plhYCATsodfDzXjgX',
                pageStartTime: '1482717342533'
            };
            var params = {
                allowFullScreen: 'true',
                allowscriptaccess: 'always',
                allowFullScreenInteractive: 'true'
            }
            swfobject.embedSWF(ctrl.srcVideo.video_flash_address, 'player_' + ctrl.srcVideo.src_video_id, "600", "400", "9.0.0", "", flashvars, params, {
                wmode: 'transparent'
            });
            ctrl.isPlaying = true;
        };
    },
    bindings: {
        srcVideo: '<',
        onPlayer: '&'
    }
});
